/*
 * RusHub - hub server for Direct Connect peer to peer network.

 * Copyright (C) 2009-2010 by Setuper
 * E-Mail: setuper at gmail dot com (setuper@gmail.com)

 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 3
 * as published by the Free Software Foundation.

 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.

 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef CTASKSLIST_H
#define CTASKSLIST_H

#include "clist.h"

namespace nLua
{

enum {
  eTB_Save           = 1 << 1,
}; /** TasksBytes */

typedef enum {
  eT_No = 0,
  eT_Save,
  eT_RestartScript,
  eT_StopScript,
  eT_MoveUp,
  eT_MoveDown,
  eT_ScriptError
} tTask; /** tTask */


class cTasksList {

  int miTackChecker; /** Bits of the common tasks */
  cList mList;

public:

  struct cTask {
    cTask():mParam(NULL){}
    cTask(tTask iType):miType(iType),mParam(NULL){}
    ~cTask(){}
    tTask miType;
    void * mParam;
  }; // cTasks

  cTasksList() : miTackChecker(0) {}
  ~cTasksList(){}


  void AddTask(void * Param, tTask iType = eT_No); /** Adding tasks */
  void CheckTasks();

private:

  void CommonTasks(); /** Common tasks */

}; // cTasksList

}; // nLua

#endif // CTASKLIST_H
